package day04.Demo02;

import java.io.FileInputStream;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.Properties;

public class Users2 {
//    定义属性
    public String uid;
    public String uname;
    public int uage;
//    定义方法
    public void hello()
    {
        System.out.println("hello()");
    }


    public String world()
    {
        System.out.println("world()");
        return "world";
    }
//    main方法
public static void main(String[] args) throws Exception{
    Properties prop = new Properties();
    prop.load(new FileInputStream("prop.properties"));
    String userstr = prop.getProperty("users");
    Class cl = Class.forName(userstr);
    Users users = (Users) cl.getDeclaredConstructor().newInstance();
    users.hello();
    users.world();
    Field[] f = cl.getFields();
    System.out.println(Arrays.toString(f));
}

}
